<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:oso="http://osoftware.com/facelets"
	template="/WEB-INF/templates/mainEditLayout.xhtml">
	
	<ui:define name="title">
			#{resourceBundle['paymentDetail.title']}
	</ui:define>
	
	<ui:define name="editFields">
		<p:wizard widgetVar="paymentWizard" flowListener="#{paymentDetailController.onFlowProcess}" backLabel="#{resourceBundle['wizard.back']}" nextLabel="#{resourceBundle['wizard.next']}">
			<p:tab id="patientData" title="1. Paciente">
				<h:panelGrid columns="1">
					<oso:selectOneMenu id="patient" 
						label="#{resourceBundle['paymentDetail.patient']}"
						value="#{paymentDetailModel.patient}" 
						converter="patientConverter"
						items="#{paymentDetailModel.selectablePatients}" 
						itemLabel="fullName"
						required="true">
					</oso:selectOneMenu>
					<p:commandButton action="newPatient" value="Nuevo Paciente" process="@this"/>
				</h:panelGrid>
			</p:tab>
			<p:tab id="paymentData" title="3. Pago">
				<h:panelGrid columns="1">
					<oso:selectOneMenu id="paymentType" 
						label="#{resourceBundle['paymentDetail.paymentType']}"
						value="#{paymentDetailModel.paymentType}" 
						converter="paymentTypeConverter"
						items="#{paymentDetailModel.selectablePaymentTypes}" 
						itemLabel="name"
						required="true"/>
				</h:panelGrid>
			</p:tab>
			<p:tab id="cashPaymentData" title="3.1 Efectivo">
				<h:panelGrid columns="1">

				</h:panelGrid>
			</p:tab>
			<p:tab id="prepaidPaymentData" title="3.2 Obra Social">
				<oso:selectOneMenu id="patientPrepaid" 
					label="#{resourceBundle['paymentDetail.patientPrepaid']}"
					value="#{paymentDetailModel.patientPrepaid}" 
					converter="patientPrepaidConverter"
					items="#{paymentDetailModel.specialist.prepaids}" 
					itemLabel="description"
					required="true" >
				</oso:selectOneMenu>				
			</p:tab>
		</p:wizard>
		

		<oso:inputText id="amount" label="#{resourceBundle['paymentDetail.amount']}"
			value="#{paymentDetailModel.amount}" required="true"/>
			
		<oso:calendar id="date" label="#{resourceBundle['paymentDetail.date']}"
			value="#{paymentDetailModel.date}"  required="true"/>
			
		<oso:selectOneMenu id="paymentConcept" 
			label="#{resourceBundle['paymentDetail.paymentConcept']}"
			value="#{paymentDetailModel.paymentConcept}" 
			converter="paymentConceptConverter"
			items="#{paymentDetailModel.selectablePaymentConcepts}" 
			itemLabel="name"
			required="true"/>	
				
		<oso:inputText id="observation" label="#{resourceBundle['paymentDetail.observation']}"
			value="#{paymentDetailModel.observation}" required="true"/>
	</ui:define>
	
</ui:composition>